package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     * 查询用户是否存在
     *
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openId}")
    public User getByOpenId(String openid);

    /**
     * 用户注册
     *
     * @param user
     */
    public void insert(User user);

    @Select("select * from user where id =#{Id}")
    public User getById(Long id);

    Integer getSumUser(Map map);
}
